//
//  AppDelegate+General.swift
//  YPWatermarkCamera
//
//  Created by 赵新 on 2022/8/8.
//

import SVProgressHUD
import UIKit
import YPBedrock
import YPKeyboardManager

#if canImport(LLDebugTool)
    import LLDebugTool
#endif

extension AppDelegate {
    func configGeneral() {
        configLLDebugTool()
        configIQKeyboardManager()
        configSVProgressHUD()
    }

    private func configLLDebugTool() {
        #if canImport(LLDebugTool)
            LLDebugTool.shared().startWorking()
        #endif
    }

    private func configIQKeyboardManager() {
        IQKeyboardManager.shared.enable = true
        IQKeyboardManager.shared.shouldResignOnTouchOutside = true
        IQKeyboardManager.shared.toolbarDoneBarButtonItemText = "完成"
    }

    private func configSVProgressHUD() {
        SVProgressHUD.setHapticsEnabled(false)
        SVProgressHUD.setDefaultMaskType(.clear)
        SVProgressHUD.setDefaultStyle(.light)
        SVProgressHUD.setShouldTintImages(false) // 禁止渲染
    }

}
